import { createRouter, createWebHistory } from 'vue-router'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { ref } from 'vue'
// 导入你的组件（懒加载推荐）
const Home = () => import('@/views/home/index.vue')
const Articles = () => import('@/views/articles/index.vue')
const Article = () => import('@/views/article/index.vue')
const Cards = () => import('@/views/cards/index.vue')
const About = () => import('@/views/about/index.vue')

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: {
      title: '空指针的夜晚 - 首页'
    },
    children:[
        {
            path: '/',
            name: 'Cards',
            component: Cards
        },
        {
            path: '/articles',
            name: 'Articles',
            component: Articles,
            meta: {
              title: '空指针的夜晚 - 文章列表'
            },
        },
        {
            path: '/article/:id',
            name: 'Article',
            component: Article
        },
        {
            path: '/about',
            name: 'About',
            component: About,
            meta: {
              title: '空指针的夜晚 - 关于我&联系我'
            },
        }
    ]
  },
]

export default routes